package test;

import model.dao.JPAHiberDAOFactory;
import model.dao.entity.BrandDAO;
import model.dao.entity.ProductDAO;
import model.entity.Brand;
import model.entity.product.ActionToy;
import model.entity.product.Computer;
import model.entity.product.Phone;
import model.entity.product.Product;
import model.entity.product.StaticToy;
import model.entity.product.TV;

public class InsertProduct {
	private static Brand b1;
	private static Brand b2;
	private static Brand b3;
	private static Brand b4;
	private static Brand b5;
	private static Brand b6;

	public static void main(String[] args) {

		// Begin: Product
		ProductDAO pDao = new ProductDAO();
		// Phone
		Phone p1 = new Phone();
		p1.setBand("654");
		p1.setBrand(b1);
		p1.setName("HTC X");
		p1.setWarranty("wegwehwh");
		p1.setSize("6546x646");
		p1.setThreeG(true);
		p1.setCamera("wehsdewc5498");
		pDao.persist(p1);

		Phone p2 = new Phone();
		p2.setBand("241");
		p2.setBrand(b3);
		p2.setName("Lumia 920");
		p2.setWarranty("1 year");
		p2.setSize(" 768 x 1280 pixels");
		p2.setThreeG(true);
		p2.setCamera("FullHD 1080p@30fps");
		pDao.persist(p2);

		Phone p3 = new Phone();
		p3.setBand("128");
		p3.setBrand(b3);
		p3.setName("Lumia 900");
		p3.setWarranty("1 year");
		p3.setSize(" 480 x 800 pixels");
		p3.setThreeG(true);
		p3.setCamera("HD 720p@30fps");
		pDao.persist(p3);

		Phone p4 = new Phone();
		p4.setBand("424");
		p4.setBrand(b4);
		p4.setName(" Samsung Galaxy Y S5360");
		p4.setWarranty("6 months");
		p4.setSize("240 x 320 Pixels");
		p4.setThreeG(true);
		p4.setCamera("2.0 MP (1600x1200 pixels)");
		pDao.persist(p4);
		// Action Toy
		ActionToy t1 = new ActionToy();
		t1.setAgeRestriction(12);
		t1.setName("Miku Neroid");
		t1.setPrice(34568);
		t1.setRemoteControl(false);
		t1.setBrand(b2);
		pDao.persist(t1);

		ActionToy t2 = new ActionToy();
		t2.setAgeRestriction(16);
		t2.setName("ferarri M9+");
		t2.setPrice(3268);
		t2.setRemoteControl(false);
		t2.setBrand(b5);
		pDao.persist(t2);

		ActionToy t3 = new ActionToy();
		t3.setAgeRestriction(15);
		t3.setName("Avatar YD-711");
		t3.setPrice(3458);
		t3.setRemoteControl(false);
		t3.setBrand(b5);
		pDao.persist(t3);

		// TV
		TV tv1 = new TV();
		tv1.setName("Samsung LA32E420");
		tv1.setBrigthness("Color");
		tv1.setBrand(b4);
		tv1.setConnection("Usb");
		tv1.setResolution("45 inches");
		tv1.setPrice(12893);
		pDao.persist(tv1);
		
		TV tv2 = new TV();
		tv2.setName("Plasma 64 inch PS64E8000");
		tv2.setBrigthness("HD");
		tv2.setBrand(b4);
		tv2.setConnection("Usb");
		tv2.setResolution("75 inches");
		tv2.setPrice(122893);
		pDao.persist(tv2);
		
		
		TV tv3 = new TV();
		tv3.setName("Sam Sung LCD");
		tv3.setBrigthness("Color");
		tv3.setBrand(b4);
		tv3.setConnection("Usb");
		tv3.setResolution("40 inches");
		tv3.setPrice(12893);
		pDao.persist(tv3);
		// Static Toy

		StaticToy st1 = new StaticToy();
		st1.setAgeRestriction(16);
		st1.setName("Nintendo");
		st1.setPrice(2628);
		st1.setMaterial("plastic");
		st1.setBrand(b5);
		pDao.persist(st1);

		StaticToy st2 = new StaticToy();
		st2.setAgeRestriction(16);
		st2.setName("ferarri M9+");
		st2.setPrice(3268);
		st2.setMaterial("plastic");
		st2.setBrand(b5);
		pDao.persist(st2);

		StaticToy st3 = new StaticToy();
		st3.setAgeRestriction(15);
		st3.setName("PSP");
		st3.setPrice(3458);
		st3.setMaterial("plastic");
		st3.setBrand(b5);
		pDao.persist(st3);

		// Computer
		Computer c1 = new Computer();
		c1.setName("DELL Inspiron 15 3521 (34500)");
		c1.setBrand(b2);
		c1.setPrice(1000);
		c1.setCPU("Core i3-3217U");
		c1.setGPU( "1.8GHz - 3M");
		c1.setRAM("4GB/1600");
		c1.setResolution(" 15.6'' HDMI");
		pDao.persist(c1);
		
		Computer c2 = new Computer();
		c2.setName("DELL Vostro 3400 (H9YKD5)");
		c2.setPrice(2300);
		c2.setCPU("Core i5-4217U");
		c2.setGPU( "1.8GHz - 3M");
		c2.setRAM("4GB/1600");
		c2.setResolution(" 15.6'' HDMI");
		pDao.persist(c2);
		
		Computer c3 = new Computer();
		c3.setName("ASUS X45C VX003 (Dark Blue)");
		c3.setPrice(900);
		c3.setBrand(b6);
		c3.setCPU("Core i3-3217U");
		c3.setGPU( "1.8GHz - 3M");
		c3.setRAM("4GB/1600");
		c3.setResolution(" 15.6'' HDMI");
		pDao.persist(c3);
		
		
		
		for (Product pro : pDao.selectAll()) {
			System.out.println(pro);
		}
		// End: Product

	}

}
